package cn.zz.veggie.application.assembler;

import cn.zz.comm.util.DateUtil;
import cn.zz.veggie.model.domain.DelMan;
import cn.zz.veggie.model.query.DelManQuery;
import cn.zz.veggie.web.types.dto.mgmt.user.MgmtDelManQueryDto;
import cn.zz.veggie.web.types.dto.mgmt.user.MgmtDelManSaveDto;

/**
 * @author zhongq
 * @since 2024/7/14
 */
public class DelManAssembler {
	public static DelManQuery buildMgmtQuery(MgmtDelManQueryDto dto) {
		final DelManQuery query = new DelManQuery();
		query.likeUsername = dto.getUsername();
		query.likeMobile = dto.getMobile();
		return query;
	}

	public static DelMan buildSaveDomain(MgmtDelManSaveDto dto) {
		final DelMan delMan = new DelMan();
		delMan.setId(dto.getId());
		delMan.setUsername(dto.getUsername());
		delMan.setMobile(dto.getMobile());
		delMan.setCreatedAt(DateUtil.getCurTimeSec());
		delMan.setUpdatedAt(DateUtil.getCurTimeSec());
		return delMan;
	}
}